# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: psykose <alice@ayaya.dev>
pkgname=py3-rich
_pkgname=rich
pkgver=12.5.0
pkgrel=0
pkgdesc="Python library for rich text formatting and terminal formatting"
url="https://rich.readthedocs.io/en/latest/"
arch="noarch"
license="MIT"
depends="
	py3-colorama
	py3-commonmark
	py3-pygments
	py3-typing-extensions
	python3
	"
makedepends="py3-build py3-installer py3-poetry-core py3-wheel"
checkdepends="py3-pytest"
source="$pkgname-$pkgver.tar.gz::https://github.com/willmcgugan/rich/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	# XXX: hack for poetry to not ignore files
	GIT_DIR=. python3 -m build --no-isolation --wheel
}

check() {
	python3 -m installer -d testenv dist/rich-$pkgver-py3-none-any.whl
	local sitedir="$(python3 -c 'import site;print(site.getsitepackages()[0])')"

	PYTHONPATH="$PWD/testenv/$sitedir" python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" dist/rich-$pkgver-py3-none-any.whl
}

sha512sums="
7aa9448d3ef14258083cbc295970fa1e184f00e2cf7a67a9bdee80cc60677ca161acdd2d570940656bf7cff9a00927a7d3e1d3bc7181a01e7e91d8e88787fded  py3-rich-12.5.0.tar.gz
"
